package com.alb.gateway.register.center.api;

import com.alb.common.config.ServiceDefinition;
import com.alb.common.config.ServiceInstance;

/**
 * @author MattS
 * @date 2024/05/08
 */
public interface RegisterCenter {

    /**
     * 初始化
     * @param registerAddress
     * @param env
     */
    void init(String registerAddress,String env);


    /**
     * 服务注册
     * @param serviceDefinition
     * @param serviceInstance
     */
    void register(ServiceDefinition serviceDefinition, ServiceInstance serviceInstance);

    /**
     * 服务注销
     * @param serviceDefinition
     * @param serviceInstance
     */
    void deregister(ServiceDefinition serviceDefinition, ServiceInstance serviceInstance);

    /**
     *  订阅所有服务
     */
    void subscribeAllServices(RegisterCenterListener registerCenterListener);
}
